package com.edais.dao;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.edais.persistence.LuckDrawMapper;
import com.edais.vo.LuckDraw;

@Repository

public class LuckDrawDao {
	@Autowired
	private LuckDrawMapper luckDrawMapper;
	
	/**
	 * 查询摇一摇奖项列表
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	public List<Map<String,Object>> queryLuckDrawList(Map<String,Object> paramMap) throws Exception{
		return luckDrawMapper.queryLuckDrawList(paramMap);
	}
	/**
	 * @Description: 抽奖配置信息
	 * @param @param ldId
	 * @param @return   
	 * @return LuckDraw  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-8-3
	 */
	public LuckDraw getLuckDraw(Long ldId) throws Exception{
		return luckDrawMapper.getLuckDraw(ldId);
	}
	/**
	 * @Description: 特殊活动抽奖次数查询
	 * @param @param userId
	 * @param @return
	 * @param @throws Exception   
	 * @return Map<String,String>  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-9-2
	 */
	public Map<String,String> getSpecEvnTimes(Long userId) throws Exception{
		return luckDrawMapper.getSpecEvnTimes(userId);
	}
	
	/**
	 * @Description: 特殊活动奖项列表
	 * @param @return
	 * @param @throws Exception   
	 * @return List<Map<String,Object>>  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-9-2
	 */
	public List<Map<String,Object>> querySpecGiftsList() throws Exception{
		return luckDrawMapper.querySpeEveDrawList();
	}
	
	/**
	 * @Description: 参与抽奖列表
	 * @param @return
	 * @param @throws Exception   
	 * @return List<Map<String,Object>>  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-9-2
	 */
	public List<Map<String,Object>> attendSpecGiftsList() throws Exception{
		return luckDrawMapper.attendSpecGiftsList();
	}
	
	/**
	 * @Description: 特殊活动奖项
	 * @param @param giftId
	 * @param @return
	 * @param @throws Exception   
	 * @return LuckDraw  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-9-2
	 */
	public LuckDraw getSpeEveDraw(Long giftId) throws Exception{
		return luckDrawMapper.getSpeEveDraw(giftId);
	}
	
	/**
	 * @Description: 记录特殊抽奖结果
	 * @param @param paramMap
	 * @param @return
	 * @param @throws Exception   
	 * @return Integer  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-9-2
	 */
	public Integer insertSpecEvent(Map<String,Object> paramMap) throws Exception{
		return luckDrawMapper.insertSpecEvent(paramMap);
	}
	/**
	 * @Description: 修改特殊抽奖次数
	 * @param @return   
	 * @return int  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-9-2
	 */
	public Integer updateSpecTimes(Long userId) throws Exception{
		return luckDrawMapper.updateSpecTimes(userId);
	}
	/**
	 * 更新库存
	 * @param giftId
	 */
	public Integer updateStore(Long giftId) {
		return luckDrawMapper.updateStore(giftId);
		
	}
	
	/**
	 * @Description: 双旦活动抽奖次数查询
	 * @param @param userId
	 * @param @return
	 * @param @throws Exception   
	 * @return Map<String,String>  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-8
	 */
	public Map<String,String> getSDTimes(Long userId) throws Exception{
		return luckDrawMapper.getSDTimes(userId);
	}
	
	/**
	 * @Description: 双旦活动奖项列表
	 * @param @return
	 * @param @throws Exception   
	 * @return List<Map<String,Object>>  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-8
	 */
	public List<Map<String,Object>> querySDGiftsList() throws Exception{
		return luckDrawMapper.querySDDrawList();
	}
	
	/**
	 * @Description: 参与抽奖列表(双旦)
	 * @param @return
	 * @param @throws Exception   
	 * @return List<Map<String,Object>>  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-8
	 */
	public List<Map<String,Object>> attendSDGiftsList(Map<String,Object> param) throws Exception{
		return luckDrawMapper.attendSDGiftsList(param);
	}
	
	/**
	 * @Description: 双旦活动奖项
	 * @param @param giftId
	 * @param @return
	 * @param @throws Exception   
	 * @return LuckDraw  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-8
	 */
	public LuckDraw getSDDraw(Long giftId) throws Exception{
		return luckDrawMapper.getSDDraw(giftId);
	}
	
	/**
	 * @Description: 记录双旦抽奖结果
	 * @param @param paramMap
	 * @param @return
	 * @param @throws Exception   
	 * @return Integer  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-8
	 */
	public Integer insertSDEvent(Map<String,Object> paramMap) throws Exception{
		return luckDrawMapper.insertSDEvent(paramMap);
	}
	/**
	 * @Description: 修改双旦抽奖次数
	 * @param @param userId
	 * @param @return
	 * @param @throws Exception   
	 * @return Integer  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-8
	 */
	public Integer updateSDTimes(Long userId) throws Exception{
		return luckDrawMapper.updateSDTimes(userId);
	}
	/**
	 * 更新双旦库存
	 * @param giftId
	 */
	public Integer updateSDStore(Long giftId) {
		return luckDrawMapper.updateSDStore(giftId);
		
	}
	/**
	 * 
	 * @Description: 抽奖记录
	 * @param @param reqMap
	 * @param @return   
	 * @return List<Map<String,Object>>  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-12
	 */
	public List<Map<String, Object>> getSDLuckDrawResult(
			Map<String, Object> reqMap)  throws Exception{
		return luckDrawMapper.getSDLuckDrawResult(reqMap);
	}
	/**
	 * @Description: 抽奖记录总数
	 * @param @param reqMap
	 * @param @throws Exception   
	 * @return int  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-12
	 */
	public int getSDLuckDrawResultSize(Map<String, Object> reqMap) throws Exception{
		return luckDrawMapper.getSDLuckDrawResultSize(reqMap);
	}
	/**
	 * @Description: 首次抽奖
	 * @param @param valueOf
	 * @param @return   
	 * @return int  
	 * @throws
	 * @author chenshufeng
	 * @date 2016-12-22
	 */
	public int updateSDFirstTimes(Long userId) throws Exception{
		return luckDrawMapper.updateSDFirstTimes(userId);
	}
}
